package jing.typedef.device.invocation;

import jing.typedef.device.Service;

/**
 * Created by ouyang on 15-9-17.
 */
public class SubscriptionInvocationFactory {

    private SubscriptionInvocationFactory() {
    }

    public static SubscriptionInvocation create(Service service) {
        SubscriptionInvocation info = new SubscriptionInvocation();

        info.setHostIp(service.getDevice().getHostIp());
        info.setHostPort(service.getDevice().getHostPort());
        info.setSubscriptionId(service.getSubscriptionId());
        info.setEventSubUrl(service.getEventSubUrl());
        info.setDiscoveryType(service.getDevice().getDiscoveryType());
        info.setDeviceId(service.getDevice().getDeviceId());

        return info;
    }
}